var express=require("express");
var router=express.Router();
var Classify=require("../models/Classify");

router.get("/",function (req,res,next) {

      Classify.find({}).then(function (allClassifyInfo) {
          var show,hide;
          if(allClassifyInfo.length>7){
              show=allClassifyInfo.slice(0,6);
              hide=allClassifyInfo.slice(6);
          }else{
              show=allClassifyInfo.slice(0,allClassifyInfo.length);
              hide=[];
          }


          res.render("main/index",{
              userInfo:req.userInfo,
              classifys:show,
              hideClassifys:hide

          });
      });


});

module.exports=router;